import React from "react";
import "./centernav.css";
import "../../index.css";
import { Outlet } from "react-router";
import { NavLink } from "react-router-dom";

export default function Centernav() {
  var oIpt = document.getElementsByTagName("input");

  for (var i = 0; i < oIpt.length; i++) {
    oIpt[i].index = i;
    oIpt[i].onclick = function () {
      if (oIpt[this.index].className === "") {
        for (var i = 0; i < oIpt.length; i++) {
          oIpt[i].className = "";
        }
        oIpt[this.index].className = "recharge_active";
      } else {
        oIpt[this.index].className = "";
      }
    };
  }

  return (
    <div>
      <div className="cennav_box1">
        <div className="cennav_head">
          {" "}
          <span>个人中心</span>
        </div>
        <div className="cennav_we">
          <div className="cennav_headme">
            <span className="cennav_a">交易管理 {">"}</span>
            <ul>
              <NavLink to="/home/person/myaccount"><li>我的账户</li></NavLink>
              <NavLink to="/home/person/myorder"><li>我的订单</li></NavLink>
              <NavLink to='/home/person/score'><li>我的积分</li></NavLink>
              <NavLink to='/home/person/scoreorder'><li>积分订单</li></NavLink>
              <NavLink to='/home/person/recharge'><li>我的钱包</li></NavLink>
            </ul>
          </div>
          <div className="cennav_headme">
            <span className="cennav_a">会员资料 {">"}</span>
            <ul>
              <NavLink to='/home/person/personaldata'><li>个人资料</li></NavLink>
              <NavLink to="/home/person/regulator"><li>地址管理</li></NavLink>
              <NavLink to="/home/person/shoppingcollection"><li>我的收藏</li></NavLink>
              <NavLink to="/home/person/browse"><li>最近浏览</li></NavLink>
              <NavLink to="/home/person/changepass">
                <li>修改密码</li>
              </NavLink>
            </ul>
          </div>
          <div className="cennav_headme">
            <span className="cennav_a">站内信 {">"}</span>
            <ul>
              <NavLink to="/home/person/mynews">
                <li>我的消息</li>
              </NavLink>
              <NavLink to="/home/person/feedback">
                <li>意见反馈</li>
              </NavLink>
            </ul>
          </div>
        </div>
      </div>

      <div className="cennav_box2">
        <Outlet></Outlet>
      </div>
    </div>
  );
}
